<?php
////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) ReloadCMS Development Team                                 //
//   http://reloadcms.sf.net                                                  //
//                                                                            //
//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
//                                                                            //
//   This product released under GNU General Public License v2                //
//////////////////////////////////////////////////////////////////////////////// 

function show_sections()
{
$list='';
$articles = new articles();
$catlist=$articles->getContainers(0);
print('//DATA BEGIN//'."\n");
print('[sections]'."\n");
foreach ($catlist as $key=>$val)
{
	print($val.'='.$key."\n");
	
}
foreach ($catlist as $key=>$val)
{
	$a = new articles();
	$a->setWorkContainer($key); 
	$c=$a->getCategories(true, false);
	$list.='['.$val.']'."\n";
	foreach ($c as $k=>$v)
	{
		$list.=$v.'='.$k."\n";
	}
}
print ($list);
exit();
}

if (isset($_GET['remoteapiaction']))
{
if ($_GET['remoteapiaction']=="showall")
{
show_sections(); 	
}
}

?>